<div id="content-flash">
    <?php if($this->session->flashdata('user') != null){ ?>
    <p id="content-notif">
        <?php
        echo $this->session->flashdata('user');
        ?>
    </p>
    <?php } ?>
</div>
<div id="content-title">
    <p id="ctitle-p">
        List User
    </p>
</div>
<div class="hor-line"></div>
<div id="content">
    <div id="user-menu">
        <div id="add-user">
            <a href="<?php echo base_url().'cp/add_user/';?>">
                + Add User
            </a>
        </div>
    </div>
    <table id="table-user">
        <tr class="tr-title">
            <td class="td-no">
                No
            </td>
            <td class="td-name">
                Name
            </td>
            <td class="td-username">
                Username
            </td>
            <td class="td-role">
                Role
            </td>
            <td class="td-action">
                Action
            </td>
        </tr>
        <?php 
        $count = 1;
        foreach($user->result() as $row){
        ?>
        <tr <?php echo (($count % 2) == 0) ? 'class="tr-round"' : '';?>>
            <td class="td-no"><?php echo $count;?></td>
            <td class="td-name"><?php echo $row->name;?></td>
            <td class="td-username"><?php echo $row->username;?></td>
            <td class="td-role"><?php echo $row->role;?></td>
            <td class="td-action">
                <a href="<?php echo base_url().'cp/edit_user/'.$row->user_id;?>">
                    Edit
                </a>
                <a href="<?php echo base_url().'user/delete/'.$row->user_id;?>">
                    Delete
                </a>
            </td>
        </tr>
        <?php
            $count++;
        }
        ?>
    </table>
</div>